<table id="contacts_list_dg"></table>
<script>
$('#contacts_list_dg').datagrid({
	border:false,
	fitColumns:true,
    url:'<?php echo base_url();?>app/contacts_data',
    columns:[[
        {field:'user_name',title:'姓名',width:100,align:'center'},
        {field:'dept_name',title:'部门',width:100,align:'center'},
		{field:'role_name',title:'角色',width:100,align:'center'},
		{field:'user_sex',title:'性别',width:100,align:'center',
			formatter: function(value,row,index){
				if(value == 0){
					return '男';
				}else if(value == 1){
					return '女';	
				}else{
					return '保密';
				}
			}
		},
		{field:'user_birthday',title:'生日',width:100,align:'center'},
		{field:'user_mobile',title:'手机',width:100,align:'center'},
		{field:'user_qq',title:'QQ',width:100,align:'center'}
    ]],
	groupField:'dept_name',
	view: groupview,
	groupFormatter:function(value, rows){
		return value + ' - ' + rows.length + ' 人';
	}
});
</script>
